home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / CommResources.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  11.3 KB  |  436 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CommResources.a
  3. ;
  4. ;    Contains:    Communications Toolbox Resource Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1988-1998, 1995-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__COMMRESOURCES__') = 'UNDEFINED' THEN
  18. __COMMRESOURCES__ SET 1
  19.  
  20.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  21.     include 'OSUtils.a'
  22.     ENDIF
  23.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  24.     include 'ConditionalMacros.a'
  25.     ENDIF
  26.  
  27.  
  28.                                                             ;    tool classes (also the tool file types)    
  29. classCM                            EQU        'cbnd'
  30. classFT                            EQU        'fbnd'
  31. classTM                            EQU        'tbnd'
  32.  
  33.                                                             ;    version of the Comm Resource Manager    
  34. curCRMVersion                    EQU        2                    ; constants general to the use of the Communications Resource Manager 
  35. crmType                            EQU        9                    ; queue type    
  36. crmRecVersion                    EQU        1                    ; version of queue structure 
  37.                                                             ;    error codes 
  38. crmGenericError                    EQU        -1
  39. crmNoErr                        EQU        0
  40. ;  data structures general to the use of the Communications Resource Manager 
  41. ; typedef OSErr                         CRMErr
  42.  
  43. CRMRec                    RECORD 0
  44. qLink                     ds.l    1                ; offset: $0 (0)        ; reserved
  45. qType                     ds.w    1                ; offset: $4 (4)        ; queue type -- ORD(crmType) = 9
  46. crmVersion                 ds.w    1                ; offset: $6 (6)        ; version of queue element data structure
  47. crmPrivate                 ds.l    1                ; offset: $8 (8)        ; reserved
  48. crmReserved                 ds.w    1                ; offset: $C (12)        ; reserved
  49. crmDeviceType             ds.l    1                ; offset: $E (14)        ; type of device, assigned by DTS
  50. crmDeviceID                 ds.l    1                ; offset: $12 (18)        ; device ID; assigned when CRMInstall is called
  51. crmAttributes             ds.l    1                ; offset: $16 (22)        ; pointer to attribute block
  52. crmStatus                 ds.l    1                ; offset: $1A (26)        ; status variable - device specific
  53. crmRefCon                 ds.l    1                ; offset: $1E (30)        ; for device private use
  54. sizeof                     EQU *                    ; size:   $22 (34)
  55.                         ENDR
  56. ; typedef struct CRMRec *                CRMRecPtr
  57.  
  58. ;
  59. ; pascal CRMErr InitCRM(void )
  60. ;
  61.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  62.         Macro
  63.         _InitCRM
  64.             move.w              #$0501,-(sp)
  65.             move.l              sp,A0
  66.             dc.w                $A08B
  67.             addq.w              #2,sp
  68.         EndM
  69.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  70.         IMPORT_CFM_FUNCTION InitCRM
  71.     ENDIF
  72.  
  73. ;
  74. ; pascal QHdrPtr CRMGetHeader(void )
  75. ;
  76.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  77.         Macro
  78.         _CRMGetHeader
  79.             move.w              #$0502,-(sp)
  80.             move.l              sp,A0
  81.             dc.w                $A08B
  82.             addq.w              #2,sp
  83.         EndM
  84.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  85.         IMPORT_CFM_FUNCTION CRMGetHeader
  86.     ENDIF
  87.  
  88. ;
  89. ; pascal void CRMInstall(CRMRecPtr crmReqPtr)
  90. ;
  91.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  92.         Macro
  93.         _CRMInstall
  94.             move.w              #$0503,-(sp)
  95.             move.l              sp,A0
  96.             dc.w                $A08B
  97.             addq.w              #2,sp
  98.         EndM
  99.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  100.         IMPORT_CFM_FUNCTION CRMInstall
  101.     ENDIF
  102.  
  103. ;
  104. ; pascal OSErr CRMRemove(CRMRecPtr crmReqPtr)
  105. ;
  106.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  107.         Macro
  108.         _CRMRemove
  109.             move.w              #$0504,-(sp)
  110.             move.l              sp,A0
  111.             dc.w                $A08B
  112.             addq.w              #2,sp
  113.         EndM
  114.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  115.         IMPORT_CFM_FUNCTION CRMRemove
  116.     ENDIF
  117.  
  118. ;
  119. ; pascal CRMRecPtr CRMSearch(CRMRecPtr crmReqPtr)
  120. ;
  121.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  122.         Macro
  123.         _CRMSearch
  124.             move.w              #$0505,-(sp)
  125.             move.l              sp,A0
  126.             dc.w                $A08B
  127.             addq.w              #2,sp
  128.         EndM
  129.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  130.         IMPORT_CFM_FUNCTION CRMSearch
  131.     ENDIF
  132.  
  133. ;
  134. ; pascal short CRMGetCRMVersion(void )
  135. ;
  136.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  137.         Macro
  138.         _CRMGetCRMVersion
  139.             move.w              #$0506,-(sp)
  140.             move.l              sp,A0
  141.             dc.w                $A08B
  142.             addq.w              #2,sp
  143.         EndM
  144.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  145.         IMPORT_CFM_FUNCTION CRMGetCRMVersion
  146.     ENDIF
  147.  
  148. ;
  149. ; pascal Handle CRMGetResource(ResType theType, short theID)
  150. ;
  151.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  152.         Macro
  153.         _CRMGetResource
  154.             move.w              #$0507,-(sp)
  155.             move.l              sp,A0
  156.             dc.w                $A08B
  157.             addq.w              #2,sp
  158.         EndM
  159.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  160.         IMPORT_CFM_FUNCTION CRMGetResource
  161.     ENDIF
  162.  
  163. ;
  164. ; pascal Handle CRMGet1Resource(ResType theType, short theID)
  165. ;
  166.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  167.         Macro
  168.         _CRMGet1Resource
  169.             move.w              #$0508,-(sp)
  170.             move.l              sp,A0
  171.             dc.w                $A08B
  172.             addq.w              #2,sp
  173.         EndM
  174.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  175.         IMPORT_CFM_FUNCTION CRMGet1Resource
  176.     ENDIF
  177.  
  178. ;
  179. ; pascal Handle CRMGetIndResource(ResType theType, short index)
  180. ;
  181.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  182.         Macro
  183.         _CRMGetIndResource
  184.             move.w              #$0509,-(sp)
  185.             move.l              sp,A0
  186.             dc.w                $A08B
  187.             addq.w              #2,sp
  188.         EndM
  189.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  190.         IMPORT_CFM_FUNCTION CRMGetIndResource
  191.     ENDIF
  192.  
  193. ;
  194. ; pascal Handle CRMGet1IndResource(ResType theType, short index)
  195. ;
  196.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  197.         Macro
  198.         _CRMGet1IndResource
  199.             move.w              #$050A,-(sp)
  200.             move.l              sp,A0
  201.             dc.w                $A08B
  202.             addq.w              #2,sp
  203.         EndM
  204.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  205.         IMPORT_CFM_FUNCTION CRMGet1IndResource
  206.     ENDIF
  207.  
  208. ;
  209. ; pascal Handle CRMGetNamedResource(ResType theType, ConstStr255Param name)
  210. ;
  211.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  212.         Macro
  213.         _CRMGetNamedResource
  214.             move.w              #$050B,-(sp)
  215.             move.l              sp,A0
  216.             dc.w                $A08B
  217.             addq.w              #2,sp
  218.         EndM
  219.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  220.         IMPORT_CFM_FUNCTION CRMGetNamedResource
  221.     ENDIF
  222.  
  223. ;
  224. ; pascal Handle CRMGet1NamedResource(ResType theType, ConstStr255Param name)
  225. ;
  226.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  227.         Macro
  228.         _CRMGet1NamedResource
  229.             move.w              #$050C,-(sp)
  230.             move.l              sp,A0
  231.             dc.w                $A08B
  232.             addq.w              #2,sp
  233.         EndM
  234.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  235.         IMPORT_CFM_FUNCTION CRMGet1NamedResource
  236.     ENDIF
  237.  
  238. ;
  239. ; pascal void CRMReleaseResource(Handle theHandle)
  240. ;
  241.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  242.         Macro
  243.         _CRMReleaseResource
  244.             move.w              #$050D,-(sp)
  245.             move.l              sp,A0
  246.             dc.w                $A08B
  247.             addq.w              #2,sp
  248.         EndM
  249.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION CRMReleaseResource
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal Handle CRMGetToolResource(short procID, ResType theType, short theID)
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  257.         Macro
  258.         _CRMGetToolResource
  259.             move.w              #$0523,-(sp)
  260.             move.l              sp,A0
  261.             dc.w                $A08B
  262.             addq.w              #2,sp
  263.         EndM
  264.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  265.         IMPORT_CFM_FUNCTION CRMGetToolResource
  266.     ENDIF
  267.  
  268. ;
  269. ; pascal Handle CRMGetToolNamedResource(short procID, ResType theType, ConstStr255Param name)
  270. ;
  271.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  272.         Macro
  273.         _CRMGetToolNamedResource
  274.             move.w              #$0526,-(sp)
  275.             move.l              sp,A0
  276.             dc.w                $A08B
  277.             addq.w              #2,sp
  278.         EndM
  279.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  280.         IMPORT_CFM_FUNCTION CRMGetToolNamedResource
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal void CRMReleaseToolResource(short procID, Handle theHandle)
  285. ;
  286.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  287.         Macro
  288.         _CRMReleaseToolResource
  289.             move.w              #$0524,-(sp)
  290.             move.l              sp,A0
  291.             dc.w                $A08B
  292.             addq.w              #2,sp
  293.         EndM
  294.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  295.         IMPORT_CFM_FUNCTION CRMReleaseToolResource
  296.     ENDIF
  297.  
  298. ;
  299. ; pascal long CRMGetIndex(Handle theHandle)
  300. ;
  301.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  302.         Macro
  303.         _CRMGetIndex
  304.             move.w              #$050E,-(sp)
  305.             move.l              sp,A0
  306.             dc.w                $A08B
  307.             addq.w              #2,sp
  308.         EndM
  309.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  310.         IMPORT_CFM_FUNCTION CRMGetIndex
  311.     ENDIF
  312.  
  313. ;
  314. ; pascal short CRMLocalToRealID(ResType bundleType, short toolID, ResType theType, short localID)
  315. ;
  316.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  317.         Macro
  318.         _CRMLocalToRealID
  319.             move.w              #$050F,-(sp)
  320.             move.l              sp,A0
  321.             dc.w                $A08B
  322.             addq.w              #2,sp
  323.         EndM
  324.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  325.         IMPORT_CFM_FUNCTION CRMLocalToRealID
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal short CRMRealToLocalID(ResType bundleType, short toolID, ResType theType, short realID)
  330. ;
  331.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  332.         Macro
  333.         _CRMRealToLocalID
  334.             move.w              #$0510,-(sp)
  335.             move.l              sp,A0
  336.             dc.w                $A08B
  337.             addq.w              #2,sp
  338.         EndM
  339.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  340.         IMPORT_CFM_FUNCTION CRMRealToLocalID
  341.     ENDIF
  342.  
  343. ;
  344. ; pascal OSErr CRMGetIndToolName(OSType bundleType, short index, Str255 toolName)
  345. ;
  346.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  347.         Macro
  348.         _CRMGetIndToolName
  349.             move.w              #$0511,-(sp)
  350.             move.l              sp,A0
  351.             dc.w                $A08B
  352.             addq.w              #2,sp
  353.         EndM
  354.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  355.         IMPORT_CFM_FUNCTION CRMGetIndToolName
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID)
  360. ;
  361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  362.         Macro
  363.         _CRMFindCommunications
  364.             move.w              #$051A,-(sp)
  365.             move.l              sp,A0
  366.             dc.w                $A08B
  367.             addq.w              #2,sp
  368.         EndM
  369.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  370.         IMPORT_CFM_FUNCTION CRMFindCommunications
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal Boolean CRMIsDriverOpen(ConstStr255Param driverName)
  375. ;
  376.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  377.         Macro
  378.         _CRMIsDriverOpen
  379.             move.w              #$0521,-(sp)
  380.             move.l              sp,A0
  381.             dc.w                $A08B
  382.             addq.w              #2,sp
  383.         EndM
  384.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  385.         IMPORT_CFM_FUNCTION CRMIsDriverOpen
  386.     ENDIF
  387.  
  388. ;
  389. ; pascal CRMErr CRMParseCAPSResource(Handle theHandle, ResType selector, unsigned long *value)
  390. ;
  391.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  392.         Macro
  393.         _CRMParseCAPSResource
  394.             move.w              #$0525,-(sp)
  395.             move.l              sp,A0
  396.             dc.w                $A08B
  397.             addq.w              #2,sp
  398.         EndM
  399.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  400.         IMPORT_CFM_FUNCTION CRMParseCAPSResource
  401.     ENDIF
  402.  
  403. ;
  404. ; pascal OSErr CRMReserveRF(short refNum)
  405. ;
  406.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  407.         Macro
  408.         _CRMReserveRF
  409.             move.w              #$0513,-(sp)
  410.             move.l              sp,A0
  411.             dc.w                $A08B
  412.             addq.w              #2,sp
  413.         EndM
  414.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  415.         IMPORT_CFM_FUNCTION CRMReserveRF
  416.     ENDIF
  417.  
  418. ;
  419. ; pascal OSErr CRMReleaseRF(short refNum)
  420. ;
  421.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  422.         Macro
  423.         _CRMReleaseRF
  424.             move.w              #$0514,-(sp)
  425.             move.l              sp,A0
  426.             dc.w                $A08B
  427.             addq.w              #2,sp
  428.         EndM
  429.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  430.         IMPORT_CFM_FUNCTION CRMReleaseRF
  431.     ENDIF
  432.  
  433.  
  434.     ENDIF ; __COMMRESOURCES__ 
  435.  
  436.